home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- BackColor = &H00C0C0C0&
- Caption = "Form1"
- ClientHeight = 5025
- ClientLeft = 1095
- ClientTop = 1485
- ClientWidth = 6570
- Height = 5430
- Left = 1035
- LinkTopic = "Form1"
- ScaleHeight = 5025
- ScaleWidth = 6570
- Top = 1140
- Width = 6690
- Begin TextBox txtAu_fname
- Height = 285
- Left = 240
- TabIndex = 13
- Top = 1920
- Width = 1935
- End
- Begin CommandButton cmdEnd
- Caption = "End"
- Height = 375
- Left = 2640
- TabIndex = 11
- Top = 4200
- Width = 1575
- End
- Begin CommandButton cmdMove
- Caption = "Last"
- Enabled = 0 'False
- Height = 495
- Index = 3
- Left = 4560
- TabIndex = 10
- Top = 120
- Width = 1215
- End
- Begin CommandButton cmdMove
- Caption = "First"
- Enabled = 0 'False
- Height = 495
- Index = 0
- Left = 600
- TabIndex = 5
- Top = 120
- Width = 1215
- End
- Begin CommandButton cmdMove
- Caption = "Previous"
- Enabled = 0 'False
- Height = 495
- Index = 2
- Left = 3240
- TabIndex = 8
- Top = 120
- Width = 1215
- End
- Begin CommandButton cmdMove
- Caption = "Next"
- Enabled = 0 'False
- Height = 495
- Index = 1
- Left = 1920
- TabIndex = 7
- Top = 120
- Width = 1215
- End
- Begin CommandButton cmdLoadDB
- Caption = "Load Database"
- Height = 375
- Left = 600
- TabIndex = 6
- Top = 4200
- Width = 1575
- End
- Begin ListBox lstTitles
- Height = 1005
- Left = 600
- TabIndex = 4
- Top = 2880
- Width = 5535
- End
- Begin TextBox txtAuId
- Height = 375
- Left = 4440
- TabIndex = 3
- Top = 1440
- Width = 1935
- End
- Begin TextBox txtAu_LName
- Height = 285
- Left = 240
- TabIndex = 1
- Top = 1080
- Width = 1935
- End
- Begin Label Label1
- BackColor = &H00C0C0C0&
- Caption = "Author's Last Name"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 12
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 1
- Left = 240
- TabIndex = 12
- Top = 1560
- Width = 2415
- End
- Begin Label Label3
- BackColor = &H00C0C0C0&
- Caption = "Titles"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 12
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 600
- TabIndex = 9
- Top = 2400
- Width = 2175
- End
- Begin Label Label2
- BackColor = &H00C0C0C0&
- Caption = "Author ID"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 12
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Left = 4440
- TabIndex = 2
- Top = 960
- Width = 1815
- End
- Begin Label Label1
- BackColor = &H00C0C0C0&
- Caption = "Author's Last Name"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 12
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 255
- Index = 0
- Left = 240
- TabIndex = 0
- Top = 720
- Width = 2415
- End
- Option Explicit
- Dim db As database
- Dim dsau As dynaset
- Dim dsTi As dynaset
- Sub cmdLoadDB_Click ()
- Dim dsconnect As String
- Dim cnt As Integer
- screen.MousePointer = 11
- dsconnect$ = "ODBC;DSN=MYSQL;DATABASE=pubs;UID=SA;PWD=;"
- Set db = OpenDatabase("", False, False, dsconnect$)
- Set dsau = db.CreateDynaset("Select au_id,au_lname,au_fname from authors")
- Call PD
- Call TD
- For cnt = 0 To 3
- cmdMove(cnt).Enabled = True
- screen.MousePointer = 0
- End Sub
- Sub cmdMove_Click (index As Integer)
- Select Case index
- Case 0
- dsau.MoveFirst
- Case 1
- dsau.MoveNext
- If dsau.EOF Then
- MsgBox "You have reached the end of file."
- dsau.MoveLast
- End If
- Case 2
- dsau.MovePrevious
- If dsau.BOF Then
- MsgBox "You have reached the beginning of file."
- dsau.MoveFirst
- End If
- Case 3
- dsau.MoveLast
- End Select
- screen.MousePointer = 11
- Call PD
- Call TD
- screen.MousePointer = 0
- End Sub
- Sub PD ()
- txtAu_FName.Text = dsau!au_fname
- txtAu_LName.Text = dsau!au_lname
- txtAuID.Text = dsau!au_ID
- End Sub
- Sub TD ()
- Dim sql As String
- Dim au As String
- au$ = txtAuID.Text
- sql$ = "Select title from titles, titleauthor where titleauthor.au_id = '" & au$ & "' and titleauthor.title_id = titles.title_id"
- Set dsTi = db.CreateDynaset(sql$)
- lsttitles.Clear
- Do Until dsTi.EOF
- lsttitles.AddItem dsTi!title
- dsTi.MoveNext
- End Sub
-